import {createWebHistory, createRouter} from 'vue-router';

// 定义路由配置
const routes = [
    {
        path: '/',
        name: 'home',
        redirect: '/graphBox',
        component: () => import('@/view/app-layout/app-layout.vue'),
        children: []
    },
    {
        path: '/graphContent',
        name: 'graphContent',
        component: () => import('@/view/app-layout/app-layout.vue'),
        meta: {
            title: '流程',
            icon: 'operations-management'
        },
        children: [
            {
                path: '/graphBox',
                name: 'graphBox',
                component: () => import('@/view/graph/graph-content.vue'),
                redirect: '/graph',
                meta: {
                    title: '编排开发',
                },
                children: [
                    {
                        path: '/graph',
                        name: 'graph',
                        component: () => import('@/view/graph/graph-list/graph-list.vue'),
                        meta: {
                            parentPath: '/graphBox',
                        }
                    }
                ]
            },
        ]
    }
];

// 创建路由实例
const router = createRouter({
    history: createWebHistory(), // 导航历史记录模式
    routes
});

export default router;
